package com.cleaningcloud.erp.mapper;

import java.util.List;

import com.cleaningcloud.erp.domain.ErpWareCheckDetails;
import com.cleaningcloud.erp.domain.ErpWareReporting;
import com.cleaningcloud.erp.domain.ErpWareReportingDetails;
import com.cleaningcloud.erp.domain.vo.ErpWareReportingVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

/**
 * 报损单Mapper接口
 * 
 * @author cleaningcloud
 * @date 2024-10-08
 */
public interface ErpWareReportingMapper 
{
    /**
     * 查询报损单
     * 
     * @param wareReportingId 报损单主键
     * @return 报损单
     */
    ErpWareReportingVo selectErpWareReportingByWareReportingId(Long wareReportingId);

    /**
     * 查询报损单列表
     * 
     * @param erpWareReporting 报损单
     * @return 报损单集合
     */
    List<ErpWareReportingVo> selectErpWareReportingList(ErpWareReporting erpWareReporting);

    /**
     * 新增报损单
     * 
     * @param erpWareReporting 报损单
     * @return 结果
     */
    int insertErpWareReporting(ErpWareReporting erpWareReporting);

    /**
     * 修改报损单
     * 
     * @param erpWareReporting 报损单
     * @return 结果
     */
    int updateErpWareReporting(ErpWareReporting erpWareReporting);

    /**
     * 删除报损单
     * 
     * @param wareReportingId 报损单主键
     * @return 结果
     */
    int deleteErpWareReportingByWareReportingId(Long wareReportingId);

    /**
     * 批量删除报损单
     * 
     * @param wareReportingIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteErpWareReportingByWareReportingIds(Long[] wareReportingIds);


    /**
     * 批量新增库存报损明细
     * @param list
     */
    void batchInsertWareReportingDetails(@Param("list")List<ErpWareReportingDetails> list);

    /**
     * 根据库存报损id批量删除明细
     * @param wareReportingId
     */
    @Delete("delete from `cleaningcloud-erp`.erp_ware_reporting_details where ware_reporting_id = #{wareReportingId}")
    void deleteWareReportingDetailsByWareCheckId(@Param("wareReportingId") Long wareReportingId);
}
